const autoprefixer = require('autoprefixer');
const pxtorem = require('postcss-pxtorem');

var Timestamp='1.7.0'

module.exports = {
  lintOnSave: false,
  baseUrl :process.env.NODE_ENV === 'production'?'./':'/',
  devServer: {
    // host:'0.0.0.0',
    // port:443,
    // https:true,
    //解决跨域
    proxy: {
      '/api': {
        target: 'http://192.168.1.181:8035', //对应自己的接口
        changeOrigin: true,
        ws: true,
        pathRewrite: {
          '^/api': ''
        }
      }
    }
  },
  css: {
    loaderOptions: {
      postcss: {
        plugins: [
          autoprefixer({
            browsers: ['Android >= 4.0', 'iOS >= 7']
          }),
          pxtorem({
            rootValue: 37.5,
            propList: ['*'],
          })
        ]
      }
    }
  },
  configureWebpack: { // webpack 配置
      output: { // 输出重构  打包编译后的 文件名称  【模块名称.版本号】
          filename: `js/[name].${Timestamp}.js`,
          chunkFilename: `js/[name].${Timestamp}.js`,
      },
  },
  
}
